{% extends "../master.html" %}
{% block page_content %}

<div class="x-nav">
    <span class="layui-breadcrumb">
        <a href="">内容审查</a>
        <a><cite>网站审查</cite></a>
        <a><cite>违规站点详情</cite></a>
    </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form class="layui-form layui-col-space5">
{#                        <!--{% raw xsrf_form_html() %}-->#}
                    </form>
                </div>
                <!-- task table-->
                <div class="layui-card-body">
                    <table class="layui-table layui-form" id="audit_table" lay-filter="option"></table>
                </div>
                <!--task table-->
            </div>
        </div>
    </div>
</div>
{% block sechfm_js %}
    <script type="text/html" id="barDemo">
      <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="details">详情</a>
      <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="snapshot">快照</a>
    </script>
{% end %}

<script>
var num = '';
for(var i=0;i<8;i++)
{
    num += Math.floor(Math.random()*10);
}
var Url = "/audit/num/" + num;
//var xsrf = $('input[name="_xsrf"]').val();
layui.use('table', function() {
    var table = layui.table;
    //方法级渲染
    table.render({
        elem: '#audit_table'
        , url: Url
        , method: 'post'
        //,where: {'xsrf_token':xsrf}
        ,where: {'site_id': '{{ site_id }}'}
        , cols: [[
            {checkbox: true, fixed: true,width:80}
            , {field: 'addr', title: 'URL',style:"color:#297890", align:'center'}
            , {field: 'keywords', title: '关键词'}
            , {field: 'last_time', align:'center', title: '发现时间', sort: true}
            ,{ title: '高级选项', align:'center', toolbar: '#barDemo'}
        ]]
        , id: 'testReload'
        , page: true
        , limit: 15
        , text: {none: '目前暂无数据'}
    });
   //头工具栏事件
    table.on('tool(option)', function(obj){
        var doubtaddr = obj.data.site_id;
        if(obj.event === 'details'){
            url = "/audit/info/SiteId";
            url = url.replace(/SiteId/,doubtaddr);
            xadmin.open('违规站点详情',url);
        }else if(obj.event === 'snapshot'){
            var Task = obj.data;
            console.log(Task);
            //url = "/keyword/list/S_id";
            //url = url.replace(/S_id/,data);
            //xadmin.open('快照',url);
        }
    });
})
</script>
{% end %}